// 装饰模式示例代码
abstract class Component {
    public abstract void operation();
}

class ConcreteComponent extends Component {
    @Override
    public void operation() { /* ... */ }
}

abstract class Decorator extends Component {
    protected Component component;

    public Decorator(Component c) { 
        this.component = c; 
    }

    @Override
    public void operation() { 
        component.operation(); 
    }
}

class ConcreteDecoratorA extends Decorator {
    public ConcreteDecoratorA(Component c) { super(c); }

    @Override
    public void operation() { 
        // add responsibilities to the component's behavior.
        super.operation(); 
    }
}